import React from "react";
import "antd/dist/antd.css";
import "es6-shim";
import {
  HashRouter as Router,
  Route,
  //   Link,
  Switch,
  Redirect
} from "react-router-dom";
import Login from "./pages/Login/index.jsx";
import Routes from "./routes.jsx";
import NotFound from "./pages/NotFound.jsx";

class App extends React.Component {
  render() {
    let LayoutRouter = <Routes />;
    return (
      <Router>
        <Switch>
          <Route exact path="/" render={() => <Redirect to="/login" push />} />
          <Route path="/404" component={NotFound} />
          <Route path="/login" component={Login} />
          <Route path="/" render={props => LayoutRouter} />
          <Route component={NotFound} />
        </Switch>
      </Router>
    );
  }
}

export default App;
